/*
 * @Author: 107w 8801453+lu-shangru@user.noreply.gitee.com
 * @Date: 2023-04-04 16:06:16
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2024-04-30 15:35:23
 * @Description:
 *
 * Copyright (c) 2023 by 107w, All Rights Reserved.
 */
import request from '@/utils/request'
// 用户登录
export function login(data) {
  return request({
    url: '/api/login',
    method: 'post',
    data
  })
}
export function exitLogin(data) {
  return request({
    url: '/admin/exitLogin',
    method: 'post',
    data
  })
}
// 新增用户
export function userInfoSave(data) {
  return request({
    url: '/admin/user/userInfoSave',
    method: 'post',
    data
  })
}
// 获取登录验证码
export function verifyCode() {
  return request({
    url: '/verifyCode',
    method: 'get',
    responseType: 'blob'
  })
}
// 获取用户信息
export function getUserInfo(params) {
  return request({
    url: '/api/menuGroup/leftMenu',
    method: 'get',
    params
  })
}

// 获取菜单
export function getMenu(params) {
  return request({
    url: '/menu/get',
    method: 'get',
    params
  })
}
// 用户登出
export function logout() {
  return request({
    url: '/vue-admin-template/user/logout',
    method: 'post'
  })
}
// 用户列表
export function getUserList() {
  return request({
    url: '/admin/user/getUserList',
    method: 'get'
  })
}

// 根据角色id获取菜单信息
export function getMenuByRoleId(params) {
  return request({
    url: '/roleInfo/getMenuByRoleId',
    method: 'get',
    params: params
  })
}
